﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RoundSystem : SystemBase
{
    private RoundStateController stateControl;
    public RoundSystem(LBattleFacade battleFacade) : base(battleFacade)
    {
        stateControl = new RoundStateController();

        stateControl.AddState(new RoundBegin(stateControl));
        stateControl.AddState(new RoundFight(stateControl));
        stateControl.AddState(new RoundAttackBefor(stateControl));
        stateControl.AddState(new RoundAttackAfter(stateControl));
        stateControl.AddState(new RoundEnd(stateControl));

    }

    public override void Init()
    {

        //==开始先进入回合开始
        stateControl.SetState(RoundType.RoundBegin);
    }

    public override void Relese()
    {
        stateControl.Release();
    }

    public override void Update()
    {
        if(stateControl!=null)
            stateControl.Update();
    }
}
